import type { Wallet } from '../../../types/Wallet'
import { getInjectedConnector, hasInjectedProvider } from '../../getInjectedConnector'
import { RabbyWalletIcon } from './rabbyWalletIcon'

export const rabbyWallet = (): Wallet => ({
  id: 'rabby',
  name: 'Rabby Wallet',
  iconUrl: RabbyWalletIcon,
  rdns: 'io.rabby',
  iconBackground: '#8697FF',
  installed: hasInjectedProvider({ flag: 'isRabby' }),
  downloadUrls: {
    chrome: 'https://chrome.google.com/webstore/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch',
    browserExtension: 'https://rabby.io'
  },
  extension: {
    instructions: {
      learnMoreUrl: 'https://rabby.io/',
      steps: [
        {
          description: 'We recommend pinning Rabby to your taskbar for quicker access to your wallet.',
          step: 'install',
          title: 'Install the Rabby extension'
        },
        {
          description:
            'Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.',
          step: 'create',
          title: 'Create or Import a Wallet'
        },
        {
          description: 'Once you set up your wallet, click below to refresh the browser and load up the extension.',
          step: 'refresh',
          title: 'Refresh your browser'
        }
      ]
    }
  },
  createConnector: getInjectedConnector({ flag: 'isRabby' })
})
